<template>
  <div id="takebacklist">


          <el-table :data="datalist" style="width: 100%" :height="dtheight" :header-cell-style="{background:'#4F81BC',color:'white'}"
           :row-class-name="tableRowClassName"  :border="true">


                <el-table-column label="订单时间"  align='center' >
                    <template slot-scope="scope">
                        <span >{{ scope.row.createtime }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="订单编号"  align='center' >
                    <template slot-scope="scope">
                        <span >{{ scope.row.pid }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="订单类别"  align='center' >
                    <template slot-scope="scope">
                        <span >{{ scope.row.manor_title }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="订单价值"  align='center' >
                    <template slot-scope="scope">
                        <span >{{ scope.row.final_price }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="产出账号"  align='center' >
                    <template slot-scope="scope">
                        <span >{{ scope.row.nickname }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="发放奖品"  align='center' >
                    <template slot-scope="scope">
                        <span >{{ selectStatus(scope.row.deliver) }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="发放蜂钻"  align='center' >
                    <template slot-scope="scope">
                        <span >{{ selectStatus(scope.row.status) }}</span>
                    </template>
                </el-table-column>

                  <el-table-column label="操作" align='center' width="300px"  fixed="right">
                    <template slot-scope="scope">
                      <el-button size="mini" :type="scope.row.deliver === 0 ? 'primary' : 'info'" round
                                 :disabled="scope.row.deliver !== 0"
                                 @click="handleSend(scope)">发货</el-button>
                      <el-button size="mini" round
                                 :disabled="scope.row.status !== 0"
                                 :class="scope.row.status === 0 ? 'active' : 'disabled'"
                                 @click="handleBee(scope)">蜂钻</el-button>
                    </template>
                </el-table-column>

            </el-table>

   </div>
</template>

<script>

export default {
   name: 'AwardOrderList',
   props:{
      datalist:{
        //type:Array,
       default:()=>[]
     },
  },
  data () {
    return {
        dtheight:'500',  //窗口高度



    }
  },
   components:{

  },
  created(){
     this.dtheight = window.innerHeight - 295

  },
  mounted (){

  },
  methods: {

     selectStatus(state) {
       switch (state) {
         case -1:
           return '查全部'
         case 0:
           return '未处理'
         case 1:
           return '已处理'
       }
     },
    handleSend(scope){
       this.$emit('handleSend',scope)
    },
    handleBee(scope){
      this.$emit('handleBee',scope)
    },
  }
}
</script>


<style scoped>
  .active {
    background-color: #F1C94A;
    color: #FFFFFF;
  }
  .disabled {
    background-color: #c8c9cc;
    color: #FFFFFF;
  }
</style>
